<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理员工申请</title>

</head>
<body>
<table width="100%" height="100%">
<tr>
	<td valign="top">
		<s:if test="%{role==0}">
			<jsp:include page="../readhead.jsp"/>
		</s:if>
		<s:elseif test="%{role==1}">
			<jsp:include page="../writehead.jsp"/>
		</s:elseif>
		<s:elseif test="%{role==2}">
			<jsp:include page="../head.jsp"/>
		</s:elseif>
	</td>
</tr>
</table>

<h2>新注册用户信息：</h2>
<table border="1" cellspacing="0">
	<tr>
		<th align="center" width="150">用户名</th>
		<th align="center" width="150">姓名</th>
		<th align="center" width="150">职位</th>
		<th align="center" width="150">联系电话</th>
		<th align="center" width="200">权限</th>
		<th width="150"></th>
		<th width="150"></th>
	</tr>
	<s:iterator id="userlist" value="applyUserList" status="status">
	
		<tr>
			<td align="left" width="150">${userlist.username}</td>
			<td align="left" width="150">${userlist.name}</td>
			<td align="left" width="150">${userlist.job}</td>
			<td align="left" width="150">${userlist.phone}</td>
			<s:if test="%{top.grade == 2}">
				<td align="left" width="200">管理员</td>
			</s:if>
			<s:elseif test="%{top.grade == 1}">
				<td align="left" width="200">高级用户(读写)</td>
			</s:elseif>
			<s:else>
				<td align="left" width="200">普通用户(只读)</td>
			</s:else>
			<s:url id="url1" action="approveApplyAction"> 
                    <s:param name="userId"> 
                        <s:property value="top.userId"/> 
                    </s:param>
            </s:url> 
            <s:url id="url2" action="rejectApplyAction"> 
                    <s:param name="userId"> 
                        <s:property value="top.userId"/> 
                    </s:param> 
            </s:url>
			<td align="center" width="150"><s:a href="%{url1}">同意申请</s:a></td>
			<td align="center" width="150"><s:a href="%{url2}">拒绝申请</s:a></td>
		</tr>

	</s:iterator>
</table>
<h2>忘记密码的用户信息：</h2>
<table border="1" cellspacing="0">
	<tr>
		<th align="center" width="150">用户名</th>
		<th align="center" width="150">姓名</th>
		<th align="center" width="150">联系电话</th>
		<th align="center" width="150">密码</th>
		<th width="150"></th>
	</tr>
	
	<s:iterator id="forgetpassUserList" value="forgetPassUserList" status="status">
	<tr>
		<td align="left" width="150">${forgetpassUserList.username}</td>
		<td align="left" width="150">${forgetpassUserList.name}</td>
		<td align="left" width="150">${forgetpassUserList.phone}</td>
		<td align="left" width="150">${forgetpassUserList.password}</td>
		<s:url id="urlp" action="okAction"> 
			<s:param name="userId"> 
				<s:property value="top.userId"/> 
            </s:param>
        </s:url>
        <td align="center" width="150"><s:a href="%{urlp}">删除该记录</s:a></td>
	</tr>
	</s:iterator>
</table>
<h2>所有用户的信息：</h2>
<table border="1" cellspacing="0">
	<tr>
		<th align="center" width="150">用户名</th>
		<th align="center" width="150">姓名</th>
		<th align="center" width="150">职位</th>
		<th align="center" width="150">联系电话</th>
		<th align="center" width="200">权限</th>
		<th width="150"></th>
		<th width="150"></th>
	</tr>
	<s:iterator id="alllist" value="allUserList" status="status">
	
		<tr>
	<td align="left" width="150">${alllist.username}</td>
			<td align="left" width="150">${alllist.name}</td>
			<td align="left" width="150">${alllist.job}</td>
			<td align="left" width="150">${alllist.phone}</td>
			<s:if test="%{top.grade == 2}">
				<td align="left" width="200">管理员</td>
			</s:if>
			<s:elseif test="%{top.grade == 1}">
				<td align="left" width="200">高级用户(读写)</td>
			</s:elseif>
			<s:else>
				<td align="left" width="200">普通用户(只读)</td>
			</s:else>
			
			<s:url id="urlm" action="manageModifyUserAction"> 
                    <s:param name="userId"> 
                        <s:property value="top.userId"/> 
                    </s:param>
            </s:url> 
            <s:url id="urld" action="deleteUserAction"> 
                    <s:param name="userId"> 
                        <s:property value="top.userId"/> 
                    </s:param> 
            </s:url>
			<td align="center" width="150"><s:a href="%{urlm}">修改用户信息</s:a></td>
			<td align="center" width="150"><s:a href="%{urld}">删除用户</s:a></td>
		</tr>
	</s:iterator>
</table>
</body>
</html>